package cn.vq3.kmsaiserver.kmsaiserver.serverlet;


import cn.vq3.kmsaiserver.kmsaiserver.service.forwardMessageService;
import com.alibaba.fastjson2.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

@RestController
@RequestMapping("kmsAi")
public class forwardMessageServlet {

    @Autowired
    forwardMessageService forwardMessageService;


    @PostMapping("/sendMessage")
    public JSONObject sendMessage(@RequestBody String message) throws IOException {
        JSONObject jsonObject = JSONObject.parseObject(message);
        return forwardMessageService.sendMessage(jsonObject);
    }
}
